<template>
  <a-spin :spinning="confirmLoading">
    <j-form-container :disabled="formDisabled">
      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
        <a-row>
          <a-col :span="24">
            <a-form-model-item label="jrjgdm" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="jrjgdm">
              <a-input v-model="model.jrjgdm" placeholder="请输入jrjgdm"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="nbjgh" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="nbjgh">
              <a-input v-model="model.nbjgh" placeholder="请输入nbjgh"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="khzjlx" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="khzjlx">
              <a-input v-model="model.khzjlx" placeholder="请输入khzjlx"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="khzjdm" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="khzjdm">
              <a-input v-model="model.khzjdm" placeholder="请输入khzjdm"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="zcdz" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="zcdz">
              <a-input v-model="model.zcdz" placeholder="请输入zcdz"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="khdqdm" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="khdqdm">
              <a-input v-model="model.khdqdm" placeholder="请输入khdqdm"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="ckzhbm" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ckzhbm">
              <a-input v-model="model.ckzhbm" placeholder="请输入ckzhbm"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="ckxydm" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ckxydm">
              <a-input v-model="model.ckxydm" placeholder="请输入ckxydm"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="ckcplb" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ckcplb">
              <a-input v-model="model.ckcplb" placeholder="请输入ckcplb"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="ckxyqsrq" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ckxyqsrq">
              <j-date placeholder="请选择ckxyqsrq" v-model="model.ckxyqsrq"  style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="ckxydqrq" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ckxydqrq">
              <j-date placeholder="请选择ckxydqrq" v-model="model.ckxydqrq"  style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="ckxysjzzrq" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ckxysjzzrq">
              <j-date placeholder="请选择ckxysjzzrq" v-model="model.ckxysjzzrq"  style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="bz" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="bz">
              <a-input v-model="model.bz" placeholder="请输入bz"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="ckye" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ckye">
              <a-input-number v-model="model.ckye" placeholder="请输入ckye" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="ckyezrmb" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ckyezrmb">
              <a-input-number v-model="model.ckyezrmb" placeholder="请输入ckyezrmb" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="llsp" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="llsp">
              <a-input-number v-model="model.llsp" placeholder="请输入llsp" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="jyrq" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="jyrq">
              <a-input v-model="model.jyrq" placeholder="请输入jyrq"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="jylsh" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="jylsh">
              <a-input v-model="model.jylsh" placeholder="请输入jylsh"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="jyfx" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="jyfx">
              <a-input v-model="model.jyfx" placeholder="请输入jyfx"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="jyqd" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="jyqd">
              <a-input v-model="model.jyqd" placeholder="请输入jyqd"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="xjzzbs" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="xjzzbs">
              <a-input v-model="model.xjzzbs" placeholder="请输入xjzzbs"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="guid" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="guid">
              <a-input v-model="model.guid" placeholder="请输入guid"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="dataDt" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dataDt">
              <a-input v-model="model.dataDt" placeholder="请输入dataDt"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="legalCode" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="legalCode">
              <a-input v-model="model.legalCode" placeholder="请输入legalCode"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="dataOrg" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dataOrg">
              <a-input v-model="model.dataOrg" placeholder="请输入dataOrg"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="manageDept" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="manageDept">
              <a-input v-model="model.manageDept" placeholder="请输入manageDept"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="datasource" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="datasource">
              <a-input v-model="model.datasource" placeholder="请输入datasource"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="dataSharps" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dataSharps">
              <a-input-number v-model="model.dataSharps" placeholder="请输入dataSharps" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="creater" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="creater">
              <a-input v-model="model.creater" placeholder="请输入creater"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="updater" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="updater">
              <a-input v-model="model.updater" placeholder="请输入updater"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="etlDt" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="etlDt">
              <a-input v-model="model.etlDt" placeholder="请输入etlDt"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="subjectNo" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="subjectNo">
              <a-input v-model="model.subjectNo" placeholder="请输入subjectNo"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="subjectName" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="subjectName">
              <a-input v-model="model.subjectName" placeholder="请输入subjectName"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="khmc" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="khmc">
              <a-input v-model="model.khmc" placeholder="请输入khmc"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="khdm" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="khdm">
              <a-input v-model="model.khdm" placeholder="请输入khdm"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="jydsmc" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="jydsmc">
              <a-input v-model="model.jydsmc" placeholder="请输入jydsmc"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="jydsckzhbm" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="jydsckzhbm">
              <a-input v-model="model.jydsckzhbm" placeholder="请输入jydsckzhbm"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="jydszhkhhh" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="jydszhkhhh">
              <a-input v-model="model.jydszhkhhh" placeholder="请输入jydszhkhhh"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="jydszjlx" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="jydszjlx">
              <a-input v-model="model.jydszjlx" placeholder="请输入jydszjlx"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="jydszjdm" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="jydszjdm">
              <a-input v-model="model.jydszjdm" placeholder="请输入jydszjdm"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="ckjyyt" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ckjyyt">
              <a-input v-model="model.ckjyyt" placeholder="请输入ckjyyt"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="yckjyyt" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="yckjyyt">
              <a-input v-model="model.yckjyyt" placeholder="请输入yckjyyt"  ></a-input>
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-form-model>
    </j-form-container>
  </a-spin>
</template>

<script>

  import { httpAction, getAction } from '@/api/manage'
  import { validateDuplicateValue } from '@/utils/util'

  export default {
    name: 'JsCdAmtNobankUnitDepositOldForm',
    components: {
    },
    props: {
      //表单禁用
      disabled: {
        type: Boolean,
        default: false,
        required: false
      }
    },
    data () {
      return {
        model:{
         },
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 },
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 },
        },
        confirmLoading: false,
        validatorRules: {
        },
        url: {
          add: "/old/jsCdAmtNobankUnitDepositOld/add",
          edit: "/old/jsCdAmtNobankUnitDepositOld/edit",
          queryById: "/old/jsCdAmtNobankUnitDepositOld/queryById"
        }
      }
    },
    computed: {
      formDisabled(){
        return this.disabled
      },
    },
    created () {
       //备份model原始值
      this.modelDefault = JSON.parse(JSON.stringify(this.model));
    },
    methods: {
      add () {
        this.edit(this.modelDefault);
      },
      edit (record) {
        this.model = Object.assign({}, record);
        this.visible = true;
      },
      submitForm () {
        const that = this;
        // 触发表单验证
        this.$refs.form.validate(valid => {
          if (valid) {
            that.confirmLoading = true;
            let httpurl = '';
            let method = '';
            if(!this.model.id){
              httpurl+=this.url.add;
              method = 'post';
            }else{
              httpurl+=this.url.edit;
               method = 'put';
            }
            httpAction(httpurl,this.model,method).then((res)=>{
              if(res.success){
                that.$message.success(res.message);
                that.$emit('ok');
              }else{
                that.$message.warning(res.message);
              }
            }).finally(() => {
              that.confirmLoading = false;
            })
          }
         
        })
      },
    }
  }
</script>